﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace QuanLyDuocPham.View.QuanLyCauHinh.NguoiDung
{
    /// <summary>
    /// Interaction logic for NHOMND_Add_View.xaml
    /// </summary>
    public partial class NHOMND_Add_View : Window
    {
        public NHOMND_Add_View()
        {
            InitializeComponent();
        }
        public delegate void added();
        public added done;
        string ma_nhomnd;
        public string _ma_nhomnd
        {
            set
            {
                ma_nhomnd = value;
            }
        }
        Controllers.QuanLyCauHinh.NguoiDung.NHOMND_Control nhomndctrl = new Controllers.QuanLyCauHinh.NguoiDung.NHOMND_Control();
        private void btOk_Click(object sender, RoutedEventArgs e)
        {
            nhomndctrl.addData(txtMa_Nhom_ND,txtDien_Giai);

            if (done != null)
            {
                done();
            }
            ma_nhomnd=nhomndctrl.loadID_moi();
            txtDien_Giai.Clear();
        }

        private void btBack_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ma_nhomnd = nhomndctrl.loadID_moi();

        }
    }
}
